import { defHttp } from "@/utils/http";

// ERP 资产信息 VO
export interface AssetInfoVO {
	asmId: number; // 资产ID
	asmName: string; // 资产名称
	asmType: string; // 资产类型
	sqNumb: number; // 资产顺序
}

// ERP 资产信息 API
export const AssetInfoApi = {
	// 查询资产信息分页
	getAssetInfoPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/asset-info/page`, params });
	},

	// 查询资产信息详情
	getAssetInfo: async (id: number) => {
		return await defHttp.get({ url: `/whs/asset-info/get?id=` + id });
	},

	// 新增资产信息
	createAssetInfo: async (data: AssetInfoVO) => {
		return await defHttp.post({ url: `/whs/asset-info/create`, data });
	},

	// 修改资产信息
	updateAssetInfo: async (data: AssetInfoVO) => {
		return await defHttp.put({ url: `/whs/asset-info/update`, data });
	},

	// 删除资产信息
	deleteAssetInfo: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/asset-info/delete?id=` + id
		});
	},

	// 导出资产信息 Excel
	exportAssetInfo: async (params: any) => {
		return await defHttp.download({ url: `/whs/asset-info/export-excel`, params });
	}
};
